package com.lifesting.front;

import com.sun.facelets.tag.MetaRule;
import com.sun.facelets.tag.Metadata;
import com.sun.facelets.tag.MetadataTarget;
import com.sun.facelets.tag.TagAttribute;

public class FilterRule extends MetaRule {

	@Override
	public Metadata applyRule(String arg0, TagAttribute arg1,
			MetadataTarget arg2) {
		if (arg2.isTargetInstanceOf(Filter.class))
		{
			if ("text".equals(arg0)){
				return new RnsRule.TextMetadata(arg1.getValue());
			}
			else if ("tableFor".equals(arg0))
			{
				return new RnsRule.TableForMetaData(arg1.getValue());
			}
		}
		return null;
	}

}
